home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_061 / microemacs / esearch.h < prev    next >
Text File  |  1992-05-06  |  2KB  |  84 lines

  1. /*
  2.  * ESEARCH.H
  3.  *
  4.  * Defines, typdefs, and global variables that are of use for the
  5.  * routines in search.c and isearch.c.
  6.  *
  7.  */
  8.  
  9. /*
  10.  * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for
  11.  * the scan routines.
  12.  */
  13. #define    PTBEG    0    /* Leave the point at the beginning on search.*/
  14. #define    PTEND    1    /* Leave the point at the end on search.*/
  15.  
  16. #if    MAGIC
  17.  
  18. /*
  19.  * Defines for the metacharacters in the regular expressions.
  20.  */
  21.  
  22. #define    MCNIL        0    /* Like the '\0' for strings.*/
  23. #define    LITCHAR        1
  24. #define    ANY        2
  25. #define    CCL        3
  26. #define    NCCL        4
  27. #define    BOL        5
  28. #define    EOL        6
  29. #define    CLOSURE        256    /* An or-able value.*/
  30. #define    MASKCL        CLOSURE - 1
  31.  
  32. #define    MC_ANY        '.'    /* 'Any' character (except newline).*/
  33. #define    MC_CCL        '['    /* Character class.*/
  34. #define    MC_NCCL        '^'    /* Negate character class.*/
  35. #define    MC_RCCL        '-'    /* Range in character class.*/
  36. #define    MC_ECCL        ']'    /* End of character class.*/
  37. #define    MC_BOL        '^'    /* Beginning of line.*/
  38. #define    MC_EOL        '$'    /* End of line.*/
  39. #define    MC_CLOSURE    '*'    /* Closure - does not extend past newline.*/
  40.  
  41. #define    MC_ESC        '\\'    /* Escape - suppress meta-meaning.*/
  42.  
  43. #define    BIT(n)        (1 << (n))    /* An integer with one bit set.*/
  44. #define    CHCASE(c)    ((c) ^ DIFCASE)    /* Toggle the case of a letter.*/
  45.  
  46. /* HICHAR - 1 is the largest character we will deal with.
  47.  * HIBYTE represents the number of bytes in the bitmap.
  48.  */
  49.  
  50. #define    HICHAR        256
  51. #define    HIBYTE        HICHAR >> 3
  52.  
  53. typedef char    *BITMAP;
  54.  
  55. typedef    struct {
  56.     short int    mc_type;
  57.     union {
  58.         int    lchar;
  59.         BITMAP    cclmap;
  60.     } u;
  61. } MC;
  62. #endif
  63.  
  64. /* Incremental search defines.
  65.  */
  66. #if    ISRCH
  67. #define    CMDBUFLEN    256    /* Length of our command buffer */
  68.  
  69. #define    IS_ABORT    0x07    /* Abort the isearch */
  70. #define IS_BACKSP    0x08    /* Delete previous char */
  71. #define    IS_TAB        0x09    /* Tab character (allowed search char) */
  72. #define IS_NEWLINE    0x0D    /* New line from keyboard (Carriage return) */
  73. #define    IS_QUOTE    0x11    /* Quote next character */
  74. #define IS_REVERSE    0x12    /* Search backward */
  75. #define    IS_FORWARD    0x13    /* Search forward */
  76. #define    IS_VMSQUOTE    0x16    /* VMS quote character */
  77. #define    IS_VMSFORW    0x18    /* Search forward for VMS */
  78. #define    IS_QUIT        0x1B    /* Exit the search */
  79. #define    IS_RUBOUT    0x7F    /* Delete previous character */
  80.  
  81. /* IS_QUIT is no longer used, the variable metac is used instead */
  82.  
  83. #endif
  84.